<template>
<SafeAreaContainer>
  <view class="container">
    <button type="default" @click="jump('/pages/index/index')">首页</button>
    <button type="default" @click="jump('/pages/other/other')">其他页</button>
    <custom-red-text></custom-red-text>
    <custom-top-charts></custom-top-charts>
    <custom-lang></custom-lang>
  </view>
</SafeAreaContainer>
</template>

<script>
import useStore from "@/store/index";
import CustomRedText from "./components/CustomRedText/CustomRedText.vue";
import CustomTopCharts from "./components/CustomTopCharts/CustomTopCharts.vue";
import CustomLang from "./components/CustomLang/CustomLang.vue";
import { getData } from "@/api/data";
export default {
  components: { CustomRedText, CustomTopCharts, CustomLang },
  data() {
    return {
      scrollTop: 0,
      broToData: {}, // 页面跳转页面传值数据对象
    };
  },
  onLoad(options) {
    // 设置页面传值的数据绑定
    this.broToData = options;
  },
  methods: {
    // 用来初始化页面需要的数据
    // 如果需要其他页面传值的数据，从 this.broToData (页面跳转页面传值数据对象) 中获取
    init() {
      this.getData();
    },
    jump(url) {
      return this.$jump(url);
    },
    async getData() {
      const data = await getData({
        id: 88888888,
        key: 88888888,
        words: "天马行空",
      });
      console.log("获取数据成功", 1);
      console.log(data, "获取数据成功", 2);
      console.log("获取数据成功", 3);
    },
  },
};
</script>

<style lang="scss" scoped>
.container {
}
</style>
